Increased usage of computers and the Internet has led to an increase in sharing content, e.g., files within directories. For example, files within a directory may be accessed by one or more users, e.g., by an application, by a client, etc., simultaneously. As described below, shared access to a common directory may cause access contentions.
Any read operation on the directory (e.g., listing the contents of the directory, requesting the attributes of the directory, requesting a lookup for a specific item in the directory) requires that the entity performing the read operation has a shared access on the directory. Merely reading a file in the directory does not fall in this category. Moreover, any update operation on the directory (e.g., creating a new entry in the directory, removing an entry from the directory, updating the attributes of the directory, moving an entry from the directory to some other directory) requires that the entity performing the update operation has an exclusive access on the directory. Merely updating a file within the directory does not fall in the above category.
Unfortunately, when one entity has a shared access on the directory, no other can have an exclusive access on the directory. But others can have shared access on the directory. Moreover, when one entity has an exclusive access on the directory, no other can have exclusive or shared access on the directory. All of the above scenarios lead to serialization of accesses to the directory. As a result of serialization, access requests to the directory are queued until they can be completed without contention. This causes system performance to degrade as access requests wait.
One conventional system to reduce this wait time has been to partition a directory when the size associated with that directory reaches a threshold limit. The presumption in the conventional system is that the increase in directory size is followed by an increase in the number of shared accesses, the number of exclusive accesses, the number of shared access requests, and the number of exclusive access requests. Thus, partitioning directories based on size is conventionally deemed to alleviate the surge in the number of accesses and the number of access requests.
Unfortunately, partitioning directories based on size does not necessarily alleviate the surge in the number of accesses and the number of access requests. In other words, directory size has shown to have no correlation with the number of accesses and the number of access requests on the directory. For example, a directory may be small in size but it may have many accesses and access requests that will lead to serialization of the access requests, thereby increasing the wait time to process access requests. On the other hand, a directory may be very large in size but may have very few accesses and very few access requests that do not lead to excessive serialization of access requests. Thus, partitioning the directory based on its size does not always improve efficiency nor reduce wait time in processing access requests.